<template>
  <el-container class="home-container">
    <el-header height="3rem">
      <div>
        <p>
          技术知识点日常记录
        </p>
      </div>
      <div>
        <el-button size="small" type="primary" icon="el-icon-edit" @click="editDatum" round></el-button>
        杨鹄铭
        <el-button size="mini" type="danger" @click="quitLogin">退出登录</el-button>
        <el-dialog
          title="内容编辑"
          :visible.sync="editDatumVisible">
          <el-input placeholder="请输入标题"
          style="margin-bottom: 1rem;width: 98%"
          ></el-input>
          <tinymce v-model="content_datum"/>
          <div style="display: flex;justify-content: center;margin-top: 1rem">
          <el-button size="mini" type="primary" @click="">提交内容</el-button>
          </div>
        </el-dialog>
      </div>
    </el-header>
    <!--  侧边栏  -->
  <el-container>
    <el-aside width="10vw">
    </el-aside>

    <el-main>
      <router-view></router-view>
    </el-main>
  </el-container>
  </el-container>
</template>

<script>
import Tinymce from "@/components/Tinymce";

export default {
  name: 'Home',
  data() {
    return {
      editDatumVisible: false,
      content_datum: '',
    }
  },
  components: { Tinymce },
  created() {
  },
  methods: {
    editDatum(){
      this.editDatumVisible = true
    },
    quitLogin(){
      this.$router.push({path: '/login'})
    }

  }
}
</script>

<style scoped lang="scss">
.home-container {
  height: 100%;
  .el-header {
    background-color: #4A5064;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #eee;
  }
  .tac {
    height: 100vh;
    background-color: #545c64;
    .el-menu {
      width: 100%;
      border: solid 1px #545c64;
    }
  }
}
</style>
